package bookstore.bound.order;

import bookstore.model.Order;
import bookstore.model.OrderItem;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class OrderDisp {
    Map<String, String> info = new HashMap<>();
    Set<OrderItemDisp> cartlst = new HashSet<>();

    public OrderDisp(Order order) {
        info.put("time", order.getTime().toString());
        info.put("name", order.getName());
        info.put("tel", order.getTel());
        info.put("addr", order.getAddr());

        for (OrderItem item : order.getItems()) {
            cartlst.add(new OrderItemDisp(item));
        }
    }

    public Map<String, String> getInfo() {
        return info;
    }

    public Set<OrderItemDisp> getCartlst() {
        return cartlst;
    }
}
